#include"linklist.cpp"
int main()
{
    LinNode * y;
    ElemType e;
    printf("单链表的基本运算：\n");
    printf("   (1)初始化单链表y\n");
    InitList(y);
    printf("   (2)依次采用尾插法插入元素a,b,c,d,e\n");
    ListInsert(y,1,'a');
    ListInsert(y,2,'b');
    ListInsert(y,3,'c');
    ListInsert(y,4,'d');
    ListInsert(y,5,'e');
    printf("    (3)输入单链表y:");Displist(y);
    printf("    (4)单链表y长度:%d\n",Listlength(y));
    printf("     (5)单链表y为%s\n",(listempty(y)?"空":"非空"));
    GetElem(y,3,e);
    printf(" (6)单链表y的第三个元素:%c\n",e);
    printf("(7)元素 a的位置:%d\n",LocateElem(y,'a'));
    printf("(8)在第四个元素上插入元素F\n");
    ListInsert(y,4,'f');
    printf("(9)输出单链表y:\n");displist(y);
    printf("(10)删除y的第5个元素\n");
    listdelete(y,5,e);
    printf("(11)输出单链表y:");displist(y);
    printf("(12)释放单链表y\n");
    destroylist(y);
    return 1;
}